home *** CD-ROM | disk | FTP | other *** search
- Path: news.uh.edu!bti!usenet
- From: "Sean C. Olson" <olson@rose.rsoc.rockwell.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Circular Usage (forward declaration?)
- Date: Wed, 17 Apr 1996 09:54:04 -0500
- Organization: Rockwell Space Operations
- Message-ID: <3175060C.6EA0@rose.rsoc.rockwell.com>
- References: <MRW.96Apr16184800@tobago.siemens.ch>
- <ltu3ykovzc.fsf@kitz.inferenzsysteme.informatik.th-darmstadt.de>
- <31747631.5970@datalytics.com> <MRW.96Apr17104121@tobago.siemens.ch> <MRW.96Apr17105737@tobago.siemens.ch>
- NNTP-Posting-Host: rose.rsoc.rockwell.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (X11; I; SunOS 5.4 sun4m)
-
- Waeckerlin Marc wrote:
- >
- > Hi there
- >
- > You have the same problem in other cases (yes I know there is an endless loop):
- >
- > class B;
- >
- > class A
- > {
- > public:
- > void b(B &x)
- > {
- > x.a(*this);
- > }
- > };
- >
- > class B
- > {
- > public:
- > void a(A &x)
- > {
- > x.b(*this);
- > }
- > };
- >
-
- This will work, but it is no longer "inlinable".
-
- class B;
-
- class A
- {
- public:
- void b(B &x);
- };
-
- class B
- {
- public:
- void a(A &x);
- };
-
- void A::b (B &x) {
- x.a (*this);
- }
-
- void B::a (A &x) {
- x.b (*this);
- }
-
- --
- Sean Olson (713) 282-3740
- Unisys Space Systems olson@rose.rsoc.rockwell.com
- RSOC
-